package com.orangelife.mobile.util;

/**
 * 点击事件时间限制
 * @author yw
 *
 */
public class ClickTouchUtils {
	private static long lastClickTime;
    /**
     * 间隔5秒才能再次点击
     * @return 
     */
    public static boolean isFastDoubleClick() {
        long time = System.currentTimeMillis();
        long timeD = time - lastClickTime;
        if ( 0 < timeD && timeD < 5000) {   
            return true;   
        }   
        lastClickTime = time;   
        return false;   
    }
    /**
     * 间隔1秒才能再次点击
     * @return 
     */
    public static boolean isFastDoubleClick1s() {
        long time = System.currentTimeMillis();
        long timeD = time - lastClickTime;
        if ( 0 < timeD && timeD < 1000) {   
            return true;   
        }   
        lastClickTime = time;   
        return false;   
    }
}
